<include file="public@header"/>
<style>
    th,td{
        text-align: center;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Wuye/baoxiu')}">报修列表</a></li>
        <li><a href="{:url('Wuye/baoxiuquestion')}">添加报修问题</a></li>
    </ul>
    <form id="submitForm" class="well form-inline margin-top-20" method="post" action="{:url('Wuye/baoxiu')}">
        分类:
        <select class="form-control" name="question_id" style="width: 140px;">
            <option value='0'>全部</option>
            <volist name="cate" id="question">
                <option value='{$question.id}'>{$question.name}</option>
            </volist>
        </select> &nbsp;&nbsp;
        关键字:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入关键字...">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger"  href="{:url('Wuye/baoxiu')}" >清空</a>
    </form>
    <form class="js-ajax-form" action="" method="post">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="15">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th width="200">报修问题</th>
                <th width="200">报修内容</th>
                <th width="200" style="text-align: left;">报修图片</th>
                <th width="200">发布时间</th>
                <th width="200">联系人/联系方式</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <notempty name="list1">
                <foreach name="list1" item="vo">
                    <tr>
                        <td>
                            <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                                   value="{$vo.id}" title="ID:{$vo.id}">
                        </td>
                        <td>
                            <span class="label label-default">
                                <a href="{:url('Wuye/baoxiu',['question_id'=>$vo.question_id])}" style="color:#fff;">{$vo.name}</a>
                            </span>
                        </td>
                        <td style="text-align: left;">{$vo.desc}</td>
                        <td>
                            <div id="layer-photos-demo{$vo.id}" class="layer-photos-demo">
                                <?php $imgrc = explode(',',$vo['imgsrc']);?>
                                <volist name="imgrc" id="imgrc">
                                    <img layer-pid="" layer-src="<?php echo cmf_get_image_url($imgrc);?>" src="<?php echo cmf_get_image_url($imgrc);?>" alt=""  width="50">
                                </volist>
                            </div>

                        </td>
                        <td><?php echo date('Y-m-d H:i',$vo['time'])?></td>
                        <td>{$vo.nickname}/<a href="tel:{$vo.phone}">{$vo.phone}</a></td>
                        <td>
                            <a href="javascript:;" onclick="del({$vo.id},'wy_baoxiu');">删除</a>
                        </td>
                    </tr>
                    <script>
                        layer.photos({
                            photos: '#layer-photos-demo{$vo.id}'
                            ,anim: <?php echo rand(1,6)?>
                        });
                    </script>
                </foreach>
            </notempty>
            <tfoot>
            <tr>
                <th width="15">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th width="200">报修问题</th>
                <th width="200">报修内容</th>
                <th style="text-align: left;">报修图片</th>
                <th width="200">发布时间</th>
                <th width="200">联系人</th>
                <th width="100">操作</th>
            </tr>
            </tfoot>
        </table>
        <div class="pagination">{$page|default=''}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<script>
    function del(id,table) {
        layer.confirm('是否删除？删除之后无法恢复', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url:"{:url('Wuye/del')}",
                data:{'id':id,'table':table},
                type:"Post",
                dataType:"json",
                success:function(data){
                    layer.msg(data.msg,{icon: 6,time: 1000},function () {
                        location.reload();
                    });
                }
            });
        }, function(){

        });
    }


</script>
</body>
</html>